decisions = {
	form_rumite_empire = {
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 60

		potential = {
			religion_group = muslim
			has_landed_title = k_rum
			NOT = { has_landed_title = e_hre }
			NOT = { has_landed_title = e_latin_empire }
			e_rum = {
				has_holder = no
			}
			e_roman_empire = {
				has_holder = no
			}
			e_roman_empire = {
				is_titular = yes
			}

			NOR = {
				has_alternate_start_setting = {
					setting = dejure
					value = random
				}
				has_alternate_start_setting = {
					setting = title_names
					value = random
				}
				has_alternate_start_setting = {
					setting = title_names
					value = random_including_duchies
				}
			}
		}

		allow = {
			religion_group = muslim
			has_landed_title = k_rum
			war = no
			prestige = 4000 
			has_landed_title = c_byzantion
			OR = {
				has_landed_title = c_thrake
				any_vassal = {
					has_landed_title = c_thrake
				}
			}
			OR = {
				has_landed_title = c_kaliopolis
				any_vassal = {
					has_landed_title = c_kaliopolis
				}
			}
			completely_controls = d_nikaea
			completely_controls = d_abydos
			completely_controls = d_adrianopolis
		}

		effect = {
			custom_tooltip = {
				text = CREATERUMITEEMPIRETEXT

				primary_title = {
					save_event_target_as = current_primary_title
				}

				e_rum = {
					copy_title_laws = PREV
				}

				grant_title = e_rum

				c_byzantion = {
					location = {
						ROOT = {
							capital = PREV
						}
					}
				}

				any_demesne_title = {
					limit = {
						NOT = {
							title = e_rum
						}
						higher_tier_than = DUKE
					}
					destroy_landed_title = THIS
				}

				k_thrace = {
					de_jure_liege = e_rum
				}

				ROOT = {
					narrative_event = { id = LOREXP.0007 }
				}
				any_playable_ruler = {
					limit = {
						OR = {
							independent = yes
							ai = no
						}
						is_within_diplo_range = ROOT
					}
					narrative_event = { id = LOREXP.0007 }
				}

				if = {
					limit = {
						religion = orthodox
					}
					k_orthodox = {
						owner = {
							grant_title_no_opinion = b_hagiasophia
						}
						set_defacto_liege = e_rum
					}
				}
			}	
		}
	}
}